layui.define(function(e) {
	layui.use(["admin", "carousel"], function() {
		var e = layui.$,
			a = (layui.admin, layui.carousel),
			t = layui.element,
			i = layui.device();
		e(".layadmin-carousel").each(function() {
			var t = e(this);
			a.render({
				elem: this,
				width: "100%",
				arrow: "none",
				interval: t.data("interval"),
				autoplay: t.data("autoplay") === !0,
				trigger: i.ios || i.android ? "click" : "hover",
				anim: t.data("anim")
			})
		}), t.render("progress")
	}), layui.use(["carousel", "echarts"], function() {
		var e = layui.$,
			a = (layui.carousel, layui.echarts);
		initCharts = function(option, id,func) {
			var t = [],n = e("#" + id).children("div"),l = function(e) {
					t[e] = a.init(n[e], layui.echartsTheme), t[e].setOption(option[e]), window.onresize = t[e].resize;
					t[e].on('click', function (params) { 
						func(params)
					});
				};
			if(n[0]) {
				l(0);
			}
		}
		function clickObj(params){
			
		}
		// 门诊营业总表
		var o_department = [{
			tooltip: {
				trigger: 'axis'
			},
			calculable: true,
			legend: {
				data: ['金额', '人均金额', '人数']
			},
			xAxis: [{
				type: 'category',
				data: ['科室一', '科室二', '科室三']
			}],
			yAxis: [{
					type: 'value',
					name: '金额（元）',
					axisLabel: {
						formatter: '{value}'
					}
				},
				{
					type: 'value',
					name: '人数',
					axisLabel: {
						formatter: '{value}'
					}
				}
			],
			series: [
				{
					name: '金额',
					type: 'bar',
					data: [600, 600,1200]
				},
				{
					name: '人均金额',
					type: 'bar',
					data: [100, 100,100]
				},
				{
					name: '人数',
					type: 'line',
					yAxisIndex: 1,
					data: [6,6,12]
				}
			]
		}]
		initCharts(o_department, "department_table",clickObj);
	}), e("collect_department", {})
});